package chixing.day10.homework;

import java.util.Arrays;

public class Test {
    public static void main(String[] args) {
        /**
         * true 因为在变量池中已经存在 ”hello“ 字符串所以会直接将b指向 ”hello“ 的地址
         */
        String a = "hello";
        String b = "he" + "llo";
        System.out.println(a == b);

        /**
         * false s1是在堆内存中，s2实在字符串变量池中
         */
        String s1 = new String("abc");
        String s2 = "abc";
        System.out.println(s1 == s2);

        String str = "abcabc";
        str.replace("a", "z");
        System.out.println(str);


        String str1 = "Java";
        String str2 = str1.concat(" Programming");
        System.out.println(str1);

        String s = "hello";
        fun(s);

        char[] chars = new char[s.length()];
        for (char c:chars) {

        }
    }

    public static void fun(String str){

    }
}
